\(\int \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx\) [1221]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 126 \[ \int \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {4 a b \csc (c+d x)}{d}+\frac {\left (2 a^2-b^2\right ) \csc ^2(c+d x)}{2 d}-\frac {2 a b \csc ^3(c+d x)}{3 d}-\frac {a^2 \csc ^4(c+d x)}{4 d}+\frac {\left (a^2-2 b^2\right ) \log (\sin (c+d x))}{d}+\frac {2 a b \sin (c+d x)}{d}+\frac {b^2 \sin ^2(c+d x)}{2 d} \]

[Out]

4*a*b*csc(d*x+c)/d+1/2*(2*a^2-b^2)*csc(d*x+c)^2/d-2/3*a*b*csc(d*x+c)^3/d-1/4*a^2*csc(d*x+c)^4/d+(a^2-2*b^2)*ln
(sin(d*x+c))/d+2*a*b*sin(d*x+c)/d+1/2*b^2*sin(d*x+c)^2/d

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 126, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {2800, 962} \[ \int \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {\left (2 a^2-b^2\right ) \csc ^2(c+d x)}{2 d}+\frac {\left (a^2-2 b^2\right ) \log (\sin (c+d x))}{d}-\frac {a^2 \csc ^4(c+d x)}{4 d}+\frac {2 a b \sin (c+d x)}{d}-\frac {2 a b \csc ^3(c+d x)}{3 d}+\frac {4 a b \csc (c+d x)}{d}+\frac {b^2 \sin ^2(c+d x)}{2 d} \]

[In]

Int[Cot[c + d*x]^5*(a + b*Sin[c + d*x])^2,x]

[Out]

(4*a*b*Csc[c + d*x])/d + ((2*a^2 - b^2)*Csc[c + d*x]^2)/(2*d) - (2*a*b*Csc[c + d*x]^3)/(3*d) - (a^2*Csc[c + d*
x]^4)/(4*d) + ((a^2 - 2*b^2)*Log[Sin[c + d*x]])/d + (2*a*b*Sin[c + d*x])/d + (b^2*Sin[c + d*x]^2)/(2*d)

Rule 962

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IGtQ[p, 0] && (IGtQ[m, 0] || (EqQ[m, -2] && EqQ[p, 1] && EqQ[d, 0]))

Rule 2800

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[(x^p*(a + x)^m)/(b^2 - x^2)^((p + 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2
 - b^2, 0] && IntegerQ[(p + 1)/2]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {(a+x)^2 \left (b^2-x^2\right )^2}{x^5} \, dx,x,b \sin (c+d x)\right )}{d} \\ & = \frac {\text {Subst}\left (\int \left (2 a+\frac {a^2 b^4}{x^5}+\frac {2 a b^4}{x^4}+\frac {-2 a^2 b^2+b^4}{x^3}-\frac {4 a b^2}{x^2}+\frac {a^2-2 b^2}{x}+x\right ) \, dx,x,b \sin (c+d x)\right )}{d} \\ & = \frac {4 a b \csc (c+d x)}{d}+\frac {\left (2 a^2-b^2\right ) \csc ^2(c+d x)}{2 d}-\frac {2 a b \csc ^3(c+d x)}{3 d}-\frac {a^2 \csc ^4(c+d x)}{4 d}+\frac {\left (a^2-2 b^2\right ) \log (\sin (c+d x))}{d}+\frac {2 a b \sin (c+d x)}{d}+\frac {b^2 \sin ^2(c+d x)}{2 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.13 \[ \int \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {4 a b \csc (c+d x)}{d}+\frac {a^2 \csc ^2(c+d x)}{d}-\frac {b^2 \csc ^2(c+d x)}{2 d}-\frac {2 a b \csc ^3(c+d x)}{3 d}-\frac {a^2 \csc ^4(c+d x)}{4 d}+\frac {a^2 \log (\sin (c+d x))}{d}-\frac {2 b^2 \log (\sin (c+d x))}{d}+\frac {2 a b \sin (c+d x)}{d}+\frac {b^2 \sin ^2(c+d x)}{2 d} \]

[In]

Integrate[Cot[c + d*x]^5*(a + b*Sin[c + d*x])^2,x]

[Out]

(4*a*b*Csc[c + d*x])/d + (a^2*Csc[c + d*x]^2)/d - (b^2*Csc[c + d*x]^2)/(2*d) - (2*a*b*Csc[c + d*x]^3)/(3*d) -
(a^2*Csc[c + d*x]^4)/(4*d) + (a^2*Log[Sin[c + d*x]])/d - (2*b^2*Log[Sin[c + d*x]])/d + (2*a*b*Sin[c + d*x])/d
+ (b^2*Sin[c + d*x]^2)/(2*d)

Maple [A] (verified)

Time = 0.64 (sec) , antiderivative size = 157, normalized size of antiderivative = 1.25

method result size
derivativedivides \(\frac {a^{2} \left (-\frac {\left (\cot ^{4}\left (d x +c \right )\right )}{4}+\frac {\left (\cot ^{2}\left (d x +c \right )\right )}{2}+\ln \left (\sin \left (d x +c \right )\right )\right )+2 a b \left (-\frac {\cos ^{6}\left (d x +c \right )}{3 \sin \left (d x +c \right )^{3}}+\frac {\cos ^{6}\left (d x +c \right )}{\sin \left (d x +c \right )}+\left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )\right )+b^{2} \left (-\frac {\cos ^{6}\left (d x +c \right )}{2 \sin \left (d x +c \right )^{2}}-\frac {\left (\cos ^{4}\left (d x +c \right )\right )}{2}-\left (\cos ^{2}\left (d x +c \right )\right )-2 \ln \left (\sin \left (d x +c \right )\right )\right )}{d}\) \(157\)
default \(\frac {a^{2} \left (-\frac {\left (\cot ^{4}\left (d x +c \right )\right )}{4}+\frac {\left (\cot ^{2}\left (d x +c \right )\right )}{2}+\ln \left (\sin \left (d x +c \right )\right )\right )+2 a b \left (-\frac {\cos ^{6}\left (d x +c \right )}{3 \sin \left (d x +c \right )^{3}}+\frac {\cos ^{6}\left (d x +c \right )}{\sin \left (d x +c \right )}+\left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )\right )+b^{2} \left (-\frac {\cos ^{6}\left (d x +c \right )}{2 \sin \left (d x +c \right )^{2}}-\frac {\left (\cos ^{4}\left (d x +c \right )\right )}{2}-\left (\cos ^{2}\left (d x +c \right )\right )-2 \ln \left (\sin \left (d x +c \right )\right )\right )}{d}\) \(157\)
parallelrisch \(\frac {2048 \left (-a^{2}+2 b^{2}\right ) \ln \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+2048 \left (a^{2}-2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-15 \left (\csc ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (a^{2} \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (\cos \left (2 d x +2 c \right )+\frac {49 \cos \left (4 d x +4 c \right )}{60}+\frac {19}{60}\right ) \left (\csc ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {256 b \left (\cos \left (2 d x +2 c \right )-\frac {\cos \left (4 d x +4 c \right )}{12}-\frac {25}{36}\right ) \sec \left (\frac {d x}{2}+\frac {c}{2}\right ) a \csc \left (\frac {d x}{2}+\frac {c}{2}\right )}{5}+\frac {256 b^{2} \left (\frac {1}{8}-\frac {\cos \left (4 d x +4 c \right )}{8}+\cos \left (2 d x +2 c \right )\right )}{15}\right ) \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2048 d}\) \(197\)
norman \(\frac {-\frac {a^{2}}{64 d}-\frac {a^{2} \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}+\frac {\left (5 a^{2}-4 b^{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{32 d}+\frac {\left (5 a^{2}-4 b^{2}\right ) \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{32 d}-\frac {\left (11 a^{2}-72 b^{2}\right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{32 d}-\frac {a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{12 d}+\frac {19 a b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}+\frac {55 a b \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}+\frac {55 a b \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}+\frac {19 a b \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}-\frac {a b \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {\left (a^{2}-2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (a^{2}-2 b^{2}\right ) \ln \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) \(295\)
risch \(-i a^{2} x +2 i b^{2} x -\frac {{\mathrm e}^{2 i \left (d x +c \right )} b^{2}}{8 d}-\frac {i a b \,{\mathrm e}^{i \left (d x +c \right )}}{d}+\frac {i a b \,{\mathrm e}^{-i \left (d x +c \right )}}{d}-\frac {{\mathrm e}^{-2 i \left (d x +c \right )} b^{2}}{8 d}-\frac {2 i a^{2} c}{d}+\frac {4 i b^{2} c}{d}+\frac {2 i \left (6 i a^{2} {\mathrm e}^{6 i \left (d x +c \right )}-3 i b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+12 a b \,{\mathrm e}^{7 i \left (d x +c \right )}-6 i a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+6 i b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-28 a b \,{\mathrm e}^{5 i \left (d x +c \right )}+6 i a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-3 i b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+28 a b \,{\mathrm e}^{3 i \left (d x +c \right )}-12 a b \,{\mathrm e}^{i \left (d x +c \right )}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{4}}+\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}-\frac {2 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) b^{2}}{d}\) \(305\)

[In]

int(cos(d*x+c)^5*csc(d*x+c)^5*(a+b*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(a^2*(-1/4*cot(d*x+c)^4+1/2*cot(d*x+c)^2+ln(sin(d*x+c)))+2*a*b*(-1/3/sin(d*x+c)^3*cos(d*x+c)^6+1/sin(d*x+c
)*cos(d*x+c)^6+(8/3+cos(d*x+c)^4+4/3*cos(d*x+c)^2)*sin(d*x+c))+b^2*(-1/2/sin(d*x+c)^2*cos(d*x+c)^6-1/2*cos(d*x
+c)^4-cos(d*x+c)^2-2*ln(sin(d*x+c))))

Fricas [A] (verification not implemented)

none

Time = 0.41 (sec) , antiderivative size = 177, normalized size of antiderivative = 1.40 \[ \int \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {6 \, b^{2} \cos \left (d x + c\right )^{6} - 15 \, b^{2} \cos \left (d x + c\right )^{4} + 6 \, {\left (2 \, a^{2} + b^{2}\right )} \cos \left (d x + c\right )^{2} - 9 \, a^{2} + 3 \, b^{2} - 12 \, {\left ({\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{4} - 2 \, {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + a^{2} - 2 \, b^{2}\right )} \log \left (\frac {1}{2} \, \sin \left (d x + c\right )\right ) - 8 \, {\left (3 \, a b \cos \left (d x + c\right )^{4} - 12 \, a b \cos \left (d x + c\right )^{2} + 8 \, a b\right )} \sin \left (d x + c\right )}{12 \, {\left (d \cos \left (d x + c\right )^{4} - 2 \, d \cos \left (d x + c\right )^{2} + d\right )}} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)^5*(a+b*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

-1/12*(6*b^2*cos(d*x + c)^6 - 15*b^2*cos(d*x + c)^4 + 6*(2*a^2 + b^2)*cos(d*x + c)^2 - 9*a^2 + 3*b^2 - 12*((a^
2 - 2*b^2)*cos(d*x + c)^4 - 2*(a^2 - 2*b^2)*cos(d*x + c)^2 + a^2 - 2*b^2)*log(1/2*sin(d*x + c)) - 8*(3*a*b*cos
(d*x + c)^4 - 12*a*b*cos(d*x + c)^2 + 8*a*b)*sin(d*x + c))/(d*cos(d*x + c)^4 - 2*d*cos(d*x + c)^2 + d)

Sympy [F(-1)]

Timed out. \[ \int \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\text {Timed out} \]

[In]

integrate(cos(d*x+c)**5*csc(d*x+c)**5*(a+b*sin(d*x+c))**2,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.83 \[ \int \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {6 \, b^{2} \sin \left (d x + c\right )^{2} + 24 \, a b \sin \left (d x + c\right ) + 12 \, {\left (a^{2} - 2 \, b^{2}\right )} \log \left (\sin \left (d x + c\right )\right ) + \frac {48 \, a b \sin \left (d x + c\right )^{3} - 8 \, a b \sin \left (d x + c\right ) + 6 \, {\left (2 \, a^{2} - b^{2}\right )} \sin \left (d x + c\right )^{2} - 3 \, a^{2}}{\sin \left (d x + c\right )^{4}}}{12 \, d} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)^5*(a+b*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

1/12*(6*b^2*sin(d*x + c)^2 + 24*a*b*sin(d*x + c) + 12*(a^2 - 2*b^2)*log(sin(d*x + c)) + (48*a*b*sin(d*x + c)^3
 - 8*a*b*sin(d*x + c) + 6*(2*a^2 - b^2)*sin(d*x + c)^2 - 3*a^2)/sin(d*x + c)^4)/d

Giac [A] (verification not implemented)

none

Time = 0.39 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.10 \[ \int \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {6 \, b^{2} \sin \left (d x + c\right )^{2} + 24 \, a b \sin \left (d x + c\right ) + 12 \, {\left (a^{2} - 2 \, b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) \right |}\right ) - \frac {25 \, a^{2} \sin \left (d x + c\right )^{4} - 50 \, b^{2} \sin \left (d x + c\right )^{4} - 48 \, a b \sin \left (d x + c\right )^{3} - 12 \, a^{2} \sin \left (d x + c\right )^{2} + 6 \, b^{2} \sin \left (d x + c\right )^{2} + 8 \, a b \sin \left (d x + c\right ) + 3 \, a^{2}}{\sin \left (d x + c\right )^{4}}}{12 \, d} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)^5*(a+b*sin(d*x+c))^2,x, algorithm="giac")

[Out]

1/12*(6*b^2*sin(d*x + c)^2 + 24*a*b*sin(d*x + c) + 12*(a^2 - 2*b^2)*log(abs(sin(d*x + c))) - (25*a^2*sin(d*x +
 c)^4 - 50*b^2*sin(d*x + c)^4 - 48*a*b*sin(d*x + c)^3 - 12*a^2*sin(d*x + c)^2 + 6*b^2*sin(d*x + c)^2 + 8*a*b*s
in(d*x + c) + 3*a^2)/sin(d*x + c)^4)/d

Mupad [B] (verification not implemented)

Time = 11.80 (sec) , antiderivative size = 310, normalized size of antiderivative = 2.46 \[ \int \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {5\,a^2}{2}-2\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {23\,a^2}{4}-4\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (3\,a^2+30\,b^2\right )-\frac {a^2}{4}+\frac {76\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{3}+\frac {356\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{3}+92\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7-\frac {4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3}}{d\,\left (16\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+32\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+16\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\right )}-\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )\,\left (a^2-2\,b^2\right )}{d}-\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d}+\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (a^2-2\,b^2\right )}{d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {3\,a^2}{16}-\frac {b^2}{8}\right )}{d}-\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{12\,d}+\frac {7\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4\,d} \]

[In]

int((cos(c + d*x)^5*(a + b*sin(c + d*x))^2)/sin(c + d*x)^5,x)

[Out]

(tan(c/2 + (d*x)/2)^2*((5*a^2)/2 - 2*b^2) + tan(c/2 + (d*x)/2)^4*((23*a^2)/4 - 4*b^2) + tan(c/2 + (d*x)/2)^6*(
3*a^2 + 30*b^2) - a^2/4 + (76*a*b*tan(c/2 + (d*x)/2)^3)/3 + (356*a*b*tan(c/2 + (d*x)/2)^5)/3 + 92*a*b*tan(c/2
+ (d*x)/2)^7 - (4*a*b*tan(c/2 + (d*x)/2))/3)/(d*(16*tan(c/2 + (d*x)/2)^4 + 32*tan(c/2 + (d*x)/2)^6 + 16*tan(c/
2 + (d*x)/2)^8)) - (log(tan(c/2 + (d*x)/2)^2 + 1)*(a^2 - 2*b^2))/d - (a^2*tan(c/2 + (d*x)/2)^4)/(64*d) + (log(
tan(c/2 + (d*x)/2))*(a^2 - 2*b^2))/d + (tan(c/2 + (d*x)/2)^2*((3*a^2)/16 - b^2/8))/d - (a*b*tan(c/2 + (d*x)/2)
^3)/(12*d) + (7*a*b*tan(c/2 + (d*x)/2))/(4*d)